
package Day10.homework;

public class string {
    public static void main(String[] args) {

    }
}
class Fun{
    Fun(String str) {
        StringBuilder result = new StringBuilder();
        int count = 1;
        char currentChar = str.charAt(0);

        for (int i = 1; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c == currentChar) {
                count++;
            } else {
                result.append(currentChar).append(count);
                count = 1;
                currentChar = c;
            }
        }

        result.append(currentChar).append(count);

        String convertedStr = result.toString();
        System.out.println(convertedStr);
    }
}

